<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title>${title}</title>
  <link rel="icon" href="${base}/images/favicon.ico" type="/image/x-icon" />
	<link rel="stylesheet" href="${base}/css/common.css">
    <link rel="stylesheet" href="${base}/css/admin.css">
    <script type="text/javascript" src="${base}/js/common.js"></script>
    <link rel="stylesheet" href="${base}/css/page.css">
	<script src="${base}/js/jquery-1.7.2.min.js" ></script>
	<script src="${base}/js/jquery.jqpagination.min.js" ></script>	
    <base href="${base}/admin/">
    <style>
    	.button{border-radius: 4px;display: inline-block;width: 100px;height: 25px;text-align: center;font-size: 14px;border: 0;color: #fff;background-color: #337ab7;transition: all .2s ease-in-out;text-shadow: 0 1px 3px rgba(0,0,0,.4),0 0 30px rgba(0,0,0,.075);}
    </style>
</head>
<body>
<#include "/common/admin_left${type}.flt">
<div class="main">
    <div class="head">
        <div class="title"><p>后台操作人员列表 </div>
        <div class="add"><a href="user?type=101" target="_blank">添加</a></div>
    </div>
    <div class="search"  >
        <form action="userList"  method="post" >
        	<input type="hidden"    name="type"  id="type" value="101" />
        	<input type="hidden"    name="page"  id="page" value="${page.pageNumber}" />
        	<input name="account" id="account" value="${account}" placeholder="账号">
            <input type="submit"  id="sub"  class="sub"  value="查询" />
        </form>
    </div>
    <div class="table project">
        <div class="hh">
        	<div class="th w9">账号</div>
        	<div class="th w9">密码</div>
        	<div class="th w9">姓名</div>
        	<div class="th w9">手机</div>
            <div class="th w20">操作</div>
        </div>
        <#list page.list as one>
		<div class="tr">
			<div class="td w9">${one.account}</div>
			<div class="td w9">${one.password}</div>
            <div class="td w9">${one.name}</div>
            <div class="td w9">${one.mobile}</div>
            <div class="td w20"><a href="user?type=101&id=${one.id}" target="_blank">更新</a> || <a href="userDel?&id=${one.id}" target="_blank">删除</a></div>
	    </div>
	     
	    <!-- end tr -->
		</#list>
	</div><!-- end table project -->
	<#include "/common/page.flt">
</div>	<!-- end table main -->
</body>
<script>
$(document).ready(function() {
	$('.pagination').jqPagination({
		link_string	: 'javascript:void(0);',
		current_page: ${page.pageNumber},
		max_page	: ${page.totalPage},
		page_string : '当前第${page.pageNumber}页,共${page.totalPage}页',
		paged		: function(page) {
			$("#page").val(page);
			$("#sub").click();
		}
	});
	
	$("#all").click(function (){
		if ($(this).attr("checked")) { 
			$("input[type='checkbox']").attr("checked","checked");
		} else {
			$("input[type='checkbox']").removeAttr("checked");
		}
	});
	$("#zhiding").click(function (){
		 $("input[name='id']:checked").each(function(){
			    facetop(this,$(this).attr("value"));
		 });
	});
	$("#shanchu").click(function (){
		 $("input[name='id']:checked").each(function(){
			 facedel(this,$(this).attr("value"));
		 });
	});
});

function facedel(obj,faceid){
	$.ajax({ url: "facedel?id="+faceid, success: function(data){
	       $("#tishi").html("删除"+data);
	        $(obj).parent().parent("div.tr").remove();
     }});
}

function facetop(obj,faceid){
	$.ajax({ url: "facetop?id="+faceid, success: function(data){
		$("#tishi").html("置顶"+data);
        $(obj).parent().parent("div.tr").remove();
     }});
}
</script>
</html>
